import request from "@/utils/request";

// 查询调查记录列表
export function listSurveyLog(query) {
  return request({
    url: "/survey/surveyLog/list",
    method: "get",
    params: query,
  });
}

// 查询调查记录列表
export function listSurveyLogByid(userid, value) {
  return request({
    url: "/survey/surveyLog/lists/" + userid,
    method: "get",
    params: value,
  });
}

// 查询调查记录详细  注释掉的是新接口
export function getSurveyLog(id) {
  return request({
    url: "/survey/surveyLog/new/" + id,
    // url: "/survey/surveyLog/" + id,
    method: "get",
  });
}

// 新增调查记录
export function addSurveyLog(data) {
  return request({
    url: "/survey/surveyLog",
    method: "post",
    data: data,
  });
}

//导出调查记录
export function batchExamine(query) {
  return request({
    url: "/survey/surveyLog/batchExamine",
    method: "put",
    data: query,
  });
}

// 修改调查记录  注释掉的是新接口
export function updateSurveyLog(data) {
  return request({
    url: "/survey/surveyLog/new/edit",
    // url: "/survey/surveyLog",
    method: "put",
    data: data,
  });
}

// 删除调查记录
export function delSurveyLog(id) {
  return request({
    url: "/survey/surveyLog/" + id,
    method: "delete",
  });
}

//导出调查记录
export function exportSurveyLog(query) {
  return request({
    url: "/survey/surveyLog/new/export",
    method: "post",
    responseType: "blob",
    data: query,
  });
}

//图片上传
export function uploadImg(data) {
  const formData = new FormData();
  formData.append("file", data);
  return request({
    url: "/common/uploadOSS",
    method: "post",
    data: formData,
  });
}
